import {createApp} from 'vue'
import '@/styles/base.css'
import router from "@/router/index.js";
import i18n from "@/includes/i18n.js";
import components from "@/components/index.js";
import store from "@/store/index.js";
import utils from "@/utils/index.js";
import api from '@/api/index.js'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

import 'nprogress/nprogress.css'
import progressBar from "./includes/progress-bar";
// 进度条
progressBar(router)

import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)

app.use(api)
app.use(i18n)
app.use(utils); // 注册全局方法
app.use(store)
app.use(router)
// 全局安装element+ icons
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
// 安装element+
app.use(ElementPlus)
app.use(components)

app.mount('#app')